'use strict';
 const db = uniCloud.database();
exports.main = async (event, context) => {
  //event为客户端上传的参数
  const collection = db.collection('comments');
  let post_id=event.post_id;
  let page=event.page-1;
  let page_size=event.page_size;
  let skip_count=page*event.page_size
  let comments=await collection.where({"p_id":post_id}).skip(skip_count).orderBy("time", "desc").get()
  return {"status":2, "lists":comments.data}
};
